<?php if (!defined('THINK_PATH')) exit(); $classid = $_GET['infoclass']; $infoid = $_GET['infoid']; ?>
<html>
<head>
	<meta charset="UTF-8">
	<title>编辑文章</title>
	<link rel="stylesheet" href="/js/bootstrap.min.css"></head>
	<link rel="stylesheet" href="/js/uploadify.css"></head>
	<script src="/js/jquery.js"></script>
	<script src="/js/jquery.uploadify.js"></script>
	<script src="/js/bootstrap.min.js"></script>
	<style type="text/css">
	table td{font-size: 12px;}
	</style>
</head>
<body>
<form id="addnews" name="addnews" method="post" action="/Admin/Editlist/editformsave/infoid/<?php echo ($infoid); ?>">
<table style="margin: 3px;" width="99%" bgcolor="#b8d0d6" border="0" cellspacing="1" cellpadding="0">
<tr>
<td height="22" width="9%" align="right" bgcolor="#FFFFFF">栏目：</td>
<td height="22" width="91%" align="left" bgcolor="#FFFFFF">
<select id="classid" name="classid">

<!-- <?php if(is_array($data)): $i = 0; $__LIST__ = $data;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i; if($vo['classid'] == $classid) { ?>
<option value="$data['classid']" selected="select"><?php echo ($vo["classname"]); ?></option>
<?php } else { ?>
<option value="$data['classid']"><?php echo ($vo["classname"]); ?></option>
<?php  } endforeach; endif; else: echo "" ;endif; ?> -->

<!-- class表中的classid要对应info表中的infoclass 这时才会被选中 seleced="select" -->
<?php if(is_array($data)): $i = 0; $__LIST__ = $data;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i; if(($vo['classid'] == $classid)): ?><option value="<?php echo ($vo["classid"]); ?>" selected="select"><?php echo ($vo["classname"]); ?></option>
<?php else: ?>
<option value="<?php echo ($vo["classid"]); ?>"><?php echo ($vo["classname"]); ?></option><?php endif; endforeach; endif; else: echo "" ;endif; ?>
</select>

</td>
</tr>
<tr>
<td height="22" width="9%" align="right" bgcolor="#FFFFFF">标题：</td>
<td height="22" width="91%" align="left" bgcolor="#FFFFFF"><input type="text" id="infotitle" name="infotitle" value="<?php echo ($infotitle); ?>"></td>
</tr>
<tr>
<td height="22" width="9%" align="right" bgcolor="#FFFFFF">缩略图：</td>
<td height="22" width="91%" align="left" bgcolor="#FFFFFF"><div id="imgs"><img width="100px" height="100px" style="margin: 10px;" src="/Uploads/<?php echo ($infothimg); ?>"></div>
<input type="file" name="infothimg" id="ups">
<input type="hidden" name="infothimg" id="img_post">

</td>


</tr>
<tr>
<td height="22" width="9%" align="right" bgcolor="#FFFFFF">内容：</td>
<td height="22" width="91%" align="left" bgcolor="#FFFFFF"><textarea id="infocontent" name="infocontent" style="height: 300px;width: 600px;"><?php echo ($infocontent); ?></textarea></td>
</tr>
<tr>
<td height="22" width="9%" align="right" bgcolor="#FFFFFF" value="infodatetime">发布时间：</td>

<td height="22" width="91%" align="left" bgcolor="#FFFFFF"><input type="text" value="<?php echo ($infodatetime); ?>" name="infodatetime" id="infodatetime"></td>
</tr>
<tr>
<td height="22" width="9%" align="right" bgcolor="#FFFFFF">点击次数：</td>
<td height="22" width="91%" align="left" bgcolor="#FFFFFF"><input type="text" name="infocount" value="<?php echo ($infocount); ?>"></td>
</tr>
<tr>
<td height="22" width="9%" align="right" bgcolor="#FFFFFF">审核状态：</td>
<td height="22" width="91%" align="left" bgcolor="#FFFFFF"><select id="infopost" name="infopost">
<?php if($infopost == 1): ?><option value="1" selected="select">审核通过</option>
<option value="0">未审核</option>
<?php else: ?>
<option value="1">审核通过</option>
<option value="0" selected="select">未审核</option><?php endif; ?>
</select></td>
</tr>
<tr>
<td height="22" align="right" bgcolor="#FFFFFF">&nbsp;</td>
<td height="22" align="left" bgcolor="#FFFFFF">
<input type="submit" value="提交"/> <input type="reset" value="重置"></td>
</tr>
</table>
</form>
<script src="/kindeditor/kindeditor-all.js"></script>
<script charset="utf-8" src="/kindeditor/lang/zh_CN.js"></script>
<script>
        KindEditor.ready(function(K) {
                window.editor = K.create('#infocontent');
        });
</script>
<script type="text/javascript">
	var img = '';
	$('#ups').uploadify({
		'swf'        : '/Public/js/uploadify.swf',
		'uploader'   : '<?php echo U("addnews/ajax_up");?>', //上传的方法
		'buttonText' : '图片上传',
		'fileTypeExts': '*.gif; *.jpg; *.png; *.jpeg',
		onUploadSuccess : function(file,data,respose){
				//把所有上传的图片都放入DIV中
				// console.log(data);
				
				$("#img_post").val(data);
				img = "<img width='100px' src='/Uploads/"+data+"'>";
				$('#imgs').html(img);//输出到模板id为imgs

		}
	});
</script>
</body>
</html>